<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<button id="button">绑定点击事件</button>
		
		<script>
			document.getElementById("button").addEventListener("click",function(){
				console.log("1")
			})
			//向 Window 对象添加事件句柄
			window.addEventListener("resize",function(){
				document.getElementById("button").innerHTML="xxxxx";
			})
			//传递参数
			function p1(name,age){
				console.log(name,age);
			}
			document.getElementById("button").addEventListener("click",p1("asa",1));
			//removeEventListener() 方法
			document.getElementById("button").removeEventListener("click");
		</script>
	</body>
</html>